<?php

//微信支付入口文件

    //加载微信配置
    // $WxSetting = $this->Payment->GetpaymentSettingInfo(array('mode'=>'wxpay'));
    require_once "WxPay.php";
    $WxSetting = array(
        'APPID'     => 'wx16320d7479a5774c',
        'MCHID'     => '1289698501',
        'KEY'       => 'fyh40082851514008285151400828515',
        'OPENDID'       => $_SESSION['Member_info'][0]['openid'],
        'CertFile'      => './cert/',
        'notifyUrl'     => 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],
    );
    // print_r($WxSetting);exit;
    $Body = 'scbkajbcjas';
    $money = 0.01;
    $trade_no = mt_rand(1000000000,9999999999);;
    $WxPay = new WxPay($WxSetting);


    //发起支付反馈参数
    $Result = $WxPay->SubmitJsApiUnifiedOrder($Body, $trade_no, $money);
    // echo 2222222;
    // print_r($Result);exit;
    //返回网页前端发起参数
    $SignParam = $WxPay->signJsApiPrepayParam($Result['prepay_id']);
    // print_r($SignParam);exit;

 ?>
